package com.dpwgc.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 定时任务
 */

@Configuration//兼备Component的效果
@EnableScheduling//定时任务开启
@EnableAsync//多线程开启
public class TimeTaskConfig {

    @Scheduled(cron = "0 */10 * * * ?")//每十钟执行一次

    //执行操作
    private void configureTasks() throws Exception {

    }
}
